# name : PRX extract value for a capture buffer, pattern, regex
# key : prxextract.prxmatch.prxposn
# contributor: Shuguang Sun
# --
retain $1;
if _N_ = 1 then
   ${1:_patternid} = prxparse(${2:'/foobar/'});

if prxmatch($1, ${3:source}) then
  ${4:match} = prxposn($1, ${5:which-group}, $3);$0